import * as api from '@/api/pack/pack';
import { reactive } from 'vue';

import { useRoute } from 'vue-router';
export default function () {
  const route = useRoute();
  const columns = reactive([
    {
      title: '资源版本',
      dataIndex: 'version'
    },
    {
      title: '录入人',
      dataIndex: 'create_name'
    },
    {
      title: '添加时间',
      dataIndex: 'create_time'
    },
    {
      title: '更新时间',
      dataIndex: 'update_time'
    },
    {
      title: '操作',
      slotName: 'handle'
    }
  ]);
  const data = reactive([
    {
      id: '1',
      name: '数据总资产超过而且服务单位全额付点钱违反人权为',
      code: 'ZY20230042',
      version: 'v1',
      create_name: '王守成',
      status: '入表中',
      create_time: '2024-6-15',
      update_time: '2024-6-25'
    }
  ]);
  let tableDate = reactive([]);
  const getBanben = async () => {
    const code = route.query.code as string;
    const obj = {
      code: code,
      page: 1,
      page_size: 30
    };
    const res = await api.getBanben(obj);
    console.log(res);
    tableDate = res.data;
  };
  return {
    columns,
    data,
    tableDate,
    getBanben
  };
}
